<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/jsp/common/common.jspf"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link type="text/css" href="${base }/css/common.css" rel="stylesheet"/>
		<link rel="stylesheet" type="text/css" href="${base }/js/plugins/jquery-validate/validationEngine.jquery.css" />
		<script type="text/javascript" src="${base }/js/jquery-1.7.min.js"></script>
		<script type="text/javascript" src="${base }/js/plugins/jquery-validate/jquery.validationEngine.js"></script>
		<script type="text/javascript" src="${base }/js/plugins/jquery-validate/jquery.validationEngine-zh_CN.js"></script>
		<title>用户注册</title>
	</head>
	<body>
		<center><h2>修改个人信息</h2></center>
		<form id="pro_form" method="post" action="${base }/user_profileDo" class="register">
		<input type="hidden" name="id" value="${user.id }" />
			<table>
				<tr>
					<td>用户名：</td>
					<td><input type="text" name="regname" id="regname" value="${user.regname }" readonly="readonly" class="text-input" /></td>
					<td>&nbsp;</td>
				</tr>
				<tr>
					<td>姓名：</td>
					<td><input type="text" name="name" id="name" value="${user.name }" class="validate[required] text-input" /></td>
					<td class="required">&nbsp;</td>
				</tr>
				<tr>
					<td>邮箱：</td>
					<td><input type="text" name="email" id="email" value="${user.email }" class="validate[required,custom[email]] text-input" /></td>
					<td class="required">&nbsp;</td>
				</tr>
				<tr>
					<td>密码：</td>
					<td><input type="password" name="password" id="password" value="${user.password }" class="validate[required] text-input" /></td>
					<td class="required">&nbsp;</td>
				</tr>
				<tr>
					<td>确认密码：</td>
					<td><input type="password" name="password2" id="password2" value="${user.password }" class="validate[required,equals[password]] text-input" /></td>
					<td class="required">&nbsp;</td>
				</tr>
				<tr>
					<td><input type="submit" value="更新信息" /></td>
					<td>
						<input type="button" value="重填" onclick="_clear();" />
						<input type="button" value="登陆" style="margin-left: 12px;" onclick="javascript:window.location.href='${base }/user_login';" />
						<input type="button" value="进入管理" style="margin-left: 12px;" onclick="javascript:window.location.href='${base }/user_my';" />
					</td>
					<td>&nbsp;</td>
				</tr>
				<tr>
					<td colspan="3" class="required">${message }</td>
				</tr>
			</table>
		</form>
		<script>
			$(document).ready(function() {
				//检测表单
				$("#pro_form").validationEngine({
					validationEventTriggers: "keyup",  //触发的事件  validationEventTriggers:"keyup blur",
					inlineValidation: true,//是否即时验证，false为提交表单时验证,默认true
					success : false,//为true时即使有不符合的也提交表单,false表示只有全部通过验证了才能提交表单,默认false
					ajaxFormValidationMethod: 'post',
					promptPosition: "topRight" //提示所在的位置，topLeft, topRight, bottomLeft,  centerRight, bottomRight
				});
			});
			
			function _clear() {
				$("input:[type='text'][name!='regname']").each(function() { $(this).val(""); });
				$(":password").each(function() { $(this).val(""); });
			}
		</script>
	</body>
</html>